package com.handsome.原型模式.浅拷贝深拷贝;

import java.io.Serializable;
import java.util.Date;

/**
 * @author niechun
 * @date 2023/1/17 21:06
 */
public class ShallowSheep implements Cloneable, Serializable {
    private String name;
    private int age ;

    private Date date;

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    protected ShallowSheep clone() throws CloneNotSupportedException {

        return (ShallowSheep) super.clone();
    }

    @Override
    public String toString() {
        return "Sheep{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
